<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Bank_model extends CI_Model
{
	
	public function __construct()
	{
		parent::__construct();
		$data=array();

	} 	
		
	
	public function insert_bank($data){
		
		$this->db->insert('bank',$data);
			
	}
		
	public function get_bank(){
		
		$query = $this->db->get('bank');

		return $query;
	}	

public function edit_bank($id){
		$query = $this->db->get_where('bank', array('id' => $id));
		return $query;
	}

public function update($edit_id, $data){
		$this->db->update('bank',$data,array('id'=>$edit_id));
	}

public function delete($id){
		$this->db->delete('bank',array('id'=>$id));		
	}
	
public function get(){
	   $this->datatables
			->select("id,name,address")
			->from("bank")		
			->add_column("Actions", 
			"<center>			<a href='edit_bank/$1' title='Edit Bank'>
								<i class='icon-edit'></i>
								</a>&nbsp;
							    <a href='delete_bank/$1' title='Delete Bank' onClick=\"return confirm('". $this->lang->line('alert_x_customer') ."')\">
								<i class='icon-trash'></i>
								</a></center>", "id")
			->unset_column('id');
		
		
	   return  $this->datatables->generate();
	
}	


}
